from rest_framework import serializers
from .models import *


class ProductsSerializer(serializers.ModelSerializer):
    class Meta:
        model = Products
        fields = '__all__'


class VersionsSerializer(serializers.ModelSerializer):
    class Meta:
        model = Versions
        fields = '__all__'


class TagsSerializer(serializers.ModelSerializer):
    class Meta:
        model = Tags
        fields = '__all__'


class DocumentSerializer(serializers.ModelSerializer):
    """Document——serializer"""

    class Meta:
        model = Document
        fields = ('id', 'title', 'create_user', 'update_time')
        depth = 2


class FAQSerializer(serializers.ModelSerializer):
    class Meta:
        model = FAQ
        fields = '__all__'
        read_only_fields = ('id', 'create_user', 'create_time', 'update_time')
        depth = 2


class ToolsSerializer(serializers.ModelSerializer):
    class Meta:
        model = Tools
        fields = '__all__'
        read_only_fields = ('id', 'create_user', 'create_time', 'update_time')
        depth = 2
